package com.mask.sca.member.feign;

import com.mask.sca.core.entity.UserDTO;
import com.mask.sca.core.response.ApiResponse;
import com.mask.sca.member.service.MemberService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author：jian
 * @Package：com.mask.sca.member.feign
 * @Project：mask-sca-cloud
 * @name：MemberController
 * @Date：2025/7/25 18:06
 * @Filename：MemberController
 */

@RestController
@RequestMapping("/api/member")
public class FeignMemberServiceImpl {

    @Resource
    private MemberService memberService;

    @GetMapping("loadByUsername")
    public ApiResponse<UserDTO> loadByUsername(@RequestParam String username) {
        return ApiResponse.success(memberService.loadByUsername(username));
    }
}
